<?php

declare(strict_types=1);

namespace app\model;

use think\facade\Db;
use think\Model;

/**
 * @mixin \think\Model
 */
class Shopcart extends Model
{
    //获取购物车单一信息
    public static function find($w = '', $field = "*")
    {
        $res = Db::name('shop_cart')->where($w)->field($field)->find();
        return $res;
    }
    //添加到购物车
    public static function add($data)
    {
        $data['add_date'] = time();
        $res = Db::name('shop_cart')->insert($data);
        return $res;
    }

    //删除购物车商品
    public static function del($ids)
    {
    }
}
